package cn.tedu.spring.exercise;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestProduct {
    @Test
    public void setproduct(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean-product.xml");
        Product product = (Product) context.getBean("product",Product.class);
        System.out.println("product="+product);
    }

    @Test
    public void productCons(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean-product.xml");
        Product product = context.getBean("productCons",Product.class);
        System.out.println("productCons ="+product);
    }

    @Test
    public void productsonct(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean-product.xml");
        Product product = context.getBean("productsonct",Product.class);
        System.out.println("productsonct ="+product);
    }
}
